libs
some cosmetic refactorings