29156 code cleanup

@prabin. Was easier to delete the old branch on gh and push the rebased one form my local. Hence the new Pull request.