Changed closures file to make use of Immediately Invoked Functions