Second bits of improvement: merging window handlers