Simplify template code