massive refactorings and tests that emphasize behaviour