Improved queries to reuse MLS common queries SQL