update deps
optimize query for smaller memory footprint