Refactoring JS, styling, docs