refactor/seperation of concerns