cleaning inventory from unnecessary queries