Maybe move this to helpers.py ?