generating codes templates and generated codes