Refactoring code: Part 3