Bug fix: Some files are not deleted when generating code

Change-Id: I3f1c7e82d30d72c6d63bd34b87f59e80e3352cc4
Internal templates

Change-Id: I2695abe0a8c8f96bb69aa1f559077963b1d4ad63
Refactoring and clean up

Change-Id: I93547ef7daa7f06d655ac2bcf6421f89b84a0d7f