PEP8 code refactoring