refactor form.py