class return large objects optimisation