redraw on window resize; refactoring