minor code tidying