Lot of refactoring.