refactoring angular resource done