Significant refactoring.