Added ability to choose the type of serialization for fields