refactored some more in attempt to improve smell