Move the serializer in its own file, change all *format* var name to *serialize*.