assorted refactorings