rework for template