Initial setup of self-executing function in JS file