Small edits to tidy the code