style: reshape the code a bit
feat: add basic mocha tests