SM-300  Extracted the common logic of the source code.