Mostly some massive refactoring.