Minor refactoring

A couple of changes to tidy up the code & use shiny python features :)