Minor code tidying