Wrap library in anonymous function