moved stuff to lib