sorting menu is done plus JS/AngularJS refactoring