Moved stuff to library