Code refactoring according to PEP8