reworked as a library