Refactoring a lot