Moving all code into self executing function.