make into lib