Extract some code to adrienbrault/form-serializer