optimizing serializeArray