Update registered widget and refactor form.js