template simplify