Refactoring in library