moved functionality to Field.js