Merging WEMI except for the XPM button implementation.