Some dashboard code improvements