contract with template generation