[RcModel] cleanup an optimise some detection code.