Assorted refactorings