maybe this could be defined outside the view so it's not defined all the time?