refactor to enable resize/redraw on terminal window resize