Tidied up some messy looking code

@markmcconachie You should add your name here for consistency.