improve callback hook