Make code more tidy for multiselect