Combine name validation and name rewrite