quick-switch & code cleanup