pylint checks

first re-factoring with input from pylint, more to do.