Update sm.py

the refactoring and reorganizing continues!