some refactoring of sumSim