Add JSDocs and refactor a little
Merge pull request #35 from Cinamonas/bugfix-minor-refactor

Add JSDocs and refactor a little