more cleanup and separation of concerns