Refactor views