refactor forms to scala