generating from template