making lib more generic