refactoring with composition