Refactor view