refactor OSiSP.cpp