Is this a helper function that should be removed from the controller file?