Added template generation