refactored following pylint analysis results