Amber/Refactored Version