Factored out grid selection