libs refactoring 2