HTML/JavaScript refactor
Merge pull request #1 from naayt/js_refactor

Js refactor