Better tests and some pep8