Project 5: Refactor code