cleanup context switching a little