More refactoring. Grrrr.