refactoring libraries