Refactored smuta.js