Refactor the views