more cleanup and nicer seperation of concerns