commented and refactored dashboard stuff