Started a massive refactoring