refactored spatialviswindow.cpp a bit