Refactor hooking utility methods