Massive refactoring TODO

:(