Trying to consolidate db queries.