moved shared code to lib package