context switch improvements