Change the frame changing logic a touch
It is now more declarative, but still has that sanitizer function
which does most of the work... Do rather want to fix that, but
not entirely sure if it'd be straightforward to do so in any kind
of pleasant fashion, so...