task 4 - refactoring