Refactor most of the library creation to the fluent API