improve DLL loader code