Refactor callback to shorter version