moved metalink stuff to library code