Improving efficiency by updating data structures