optimize kwbd and alt buffer swap behavior