Actually, the length of time that a person has been living in a state merely constitutes or permits a "rebuttable presumption of residency". Look it up. It means that it only allows the state (or e.g. an officer doing a traffic stop) to "presume" your residency, but you can "rebut" or dispute that presumption of residency based on the actual "evidence of residency" that is established by the legislature, administrative rule-making, or the courts.
That's why the DMV uses the language "rebuttable presumption of residency". Again, none of the established or acceptable "evidence of residency" outlined by the DVM applies to me, except perhaps for a very liberal/permissive reading of the last one (because it is so vague). However, I DID substantially meet the established "evidence of residency" in another state (I don't anymore). When a person substantially meets the "evidence of residency" accepted in one state, but not the other state, one state must defer to the other. Full Faith and Credit, and all that jazz.
Perhaps it is "sketchy", but the law doesn't say anything about one's reasons for doing it must be free of "sketchyness" and courts have not found that one's reasons for doing so must be free of "sketchyness" (merely being advantageous or convenient to them is perfectly acceptable). Just free of objectively or materially false statements, which I haven't made.