Improving anonymous type behaviour