code refactor - project 1