refactor to be purely view-based