factor out search limits