pep-8 compliant and minor code cleanup