Rewrite task.py and view.py