refactor dashboard helper