iteration 2 - refactor