minor code tidies