refactored dashboard controller