Finish refactoring (5.6 Exercises)