completed refactoring of the code based on the 3dr services client lib update.