Wrapped code in anonymous immediate function to avoid global variable leaks.