refactor dashboardHandler