simple the logic

Simplify the judge logic of callback function.