modernization: avoid copy of big cpp container, using references instead