Refactor to views