Task Two refactoring