refactoring admin panel to angularjs