Improved build classes caching