refactor view using build widget