Please use `var extend = function extend` to avoid side effects from function hoisting.