update to reduce queries