fn to make rendering with template easier