changed view, moved more logic to view from model