remove code duplication
Merge pull request #10725 from neerajdotname/remove_code_duplication

Remove code duplication