use view and refactor