Dashboard JS Refactor