refactor form.rb