solution to partial application
refactor solution: