Refactor and move form to external file.