Further performance improvements for needs-building.