making some cleanups and pep8 compatbility