Refactor dashboards_controller