Big refactoring with no tests :D