CLN: moved shift logic from frame.py to internals.py