[BD] Refactor controlskip.py.
[BD] Merge code.