[JR] Refactor dashboard.py