FAIMS-238: cleaning up queries