Lot of refactoring...