cleanup and making code pass some pep8