update to use IIFE