better seperation of concerns between functions