Hook refactor