Refactored dashboard controller