JS syntax improvement