Refactoring of LoadLibrary()