implementing templates