implementing templates model