began library loading refactoring