Finally implemented new template engine