cleaning up and combining queries.