Store query info in state instead of looking up in preferences