Large amount of refactoring