Refactor the code using an IFFE so that there are not variables or function in the global scope.