Do a couple of things a bit more pythonically