dashboard code cleaned up