refactors some code smells (javascript)
Merge pull request #18 from folieadrien/removes-code-smells

refactors some code smells (javascript)