More refactoring

Perhaps too much