Refactor post-up hook