change function hirearchy, introduce higher level modules, adapt test scripts