some optimizatios with value classes