Extensive optimizations to screen wipe code