changes ugly `new function` pattern to cleaner IIFE