template simplification