Huge freaking refactoring... Still tons to do...