major hook refactoring