optimize SOD logic

optimize SOD logic