refactored a bit
Merge branch 'master' of https://github.com/gustavjon/rsm