Gradual, non destructive refactoring

Gradual, non destructive refactoring, all the while keeping all of the
unit tests working