More refactoring. It's no longer absolutely horrifying.