simplify template regex