js service refactoring