yay more refactoring