refactoring, simplification; all existing tests passing again