Refactor code to finish Module 1