refactored some common osg wn scripts