Large refactoring in progress.