Library partial refactoring