Tidy up: remove dead code and fix some minor pylint errors