Removed unused ElementTree import
Refactoring to keep Pylint happy
Removing remaining dict addition stuff

Py3 compatibility