did some more refactoring in an attempt to improve smell