switch to generics
make lib interface public