Code optimization, removed couple of now unnecessary IIFEs