generation and templates