redesigned the views.py