extract queryies to a separate class