Code refactoring and Device Client Impl