refactor serializeForm