refactor view