Week 5. Problems 1,2 Complete refactoring