change queries to use options