README updated
Small JS refactor