task 02 -refactored