Added an IIFE to prevent deoptimization