second task - refactoring