libraryize a bit better