A huge code refactoring.