[RcModel] cleanup and simplify detection code.