Cleaned code in views.py