Refactor for cleaner views and repository