A round of refactoring