Refactor code: Part 2