Found a solution for implementing templates.