refactor callback interface