Updating code to run in both CHD3/4 and Hortonworks current releases

Updated code after the review