Simplify selection code and api