Dashboard code cleanup