Refactoring to library.