Refactor forms to Ruby