shuffle some unloading code from util to initialize