Refactor home view