fixed alignment in dashboard and made code more DRY