Refactor portal view and angularjs