Assorted bits of refactoring
Assorted bits of refactoring