* adding testcoverage and some structural refactorings