remove useless pattern matching in callback