rewrite some match exprs by ActivePattern