Split generic code from RMSD collector