Refactoring task3