Changing functions to immediately-invoked function expressions