refactor to dashboard and some controller tests!