Refactor callback method.