More refactoring yay!