moved some methods to library