refactor dashboard helpers.