Refactored code - interlude checkpoint