Refactor views.py using render