Made some cleanup (dead code) and small optimizations
[Generator] [Behavior] simplified code
Merge pull request #447 from hhamon/remove_dead_code

Made some cleanup (dead code) and small optimizations