modularize queries