refactored views.py for easier tracing, fixes #214