refactoring tests; +pep8