cleaned up dashboard code