Simplify DotSerializer using lambdas