I'd pull this out to a helper as well. This exposes too much knowledge about how usernames are retrieved in the view.