minor code tidy up