moved name generating out of view to model