Minor code tidying up