Refactored forms.py code