refactoring
resize needed to redraw viewport