Fixed pep8, flake8 and pylint issues

- Cleaned the code as per pep8, flake8 guidelines