convert library and its tests refactored