Refactoring the latest /cstoggle changes