Refactoring task4