Refactor following pylint
Refactor using landscape.io's suggestions