changing from two queries to a single cli command