refactor dashboards controller