Some code cleanup (JS coding standards) and moved levels variable into functional scope