WIP: More refactoring.