refactor the logic needed to modify and update PD weights in the tool