fixed refactor for seperation of concerns