Cleaner activation and deactivation of TREX (using new API).