Move codes to library.