more refactoring that i missed in the last commit