refactor setdropdown into common functions