optimized composing of entity references