Code refactor using PEP8