various refactoring changes I had hanging around