code refactor, pep8 ok