level.js var refactor