Start moving out some view helper logic to utils.py