Some serious fuckin refactoring.