Some refactoring to get some PyLint compliance