refactor - seperation of responsibilities