restructured views.py