simplify template code