better way to pass vars to view