More refactoring changes and adjustsments to the structuring of the km-tools