moving code out of iifes