#138: Query controllers refactor