simplify code for hook usage search