Cleaned up code in _entites.py generator module.
Simplified/cleaned up more code in the _entities.py generation module.