Libs refactoring