Refactoring hdp plugin

* Remove duplicate code

Change-Id: I94b7f730ac28dbbbe9c0216649188fd198658fa7
Merge "Refactoring hdp plugin"