Refactor code to be pep8 compliant