Adapted XPM scripts