Refactored code following coach review