Libraries refactoring