extract field code to Field class
fixed ugly namespaces