Refactor view.py into separate files.