Stable refactored version of DCS/XRF module