eliminated some duplicated code
minor style fixes for jshint
moved common form view logic to common FormView class