[refactor] hooks.py fixes