Switched to code generation for serialization as well