Reduce duplication of queries in ACP games overview

Reduce the duplication of queries in the ACP search, which is mostly due to the
search functionality. But, the only difference was located in the where part,
which has now been separated. The where's now determined once, and passed where
appropriate.