move some tests to library