Is it possible to move this input munging to the definition instead of doing it in the template?