Refactoring of screen unblanking in gui.py