Refactored according to pylint suggestions.