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