optimized queries to 3rd party