Wraps code into self executing functions