Continuation of first round refactoring.