move some of the selection logic client side