improve optimization of SetSTN