several updates to the architecture of this library