refactor callback chain