refactoring the dashboard class