refactoring testing

tested, some problems occured. but generally OK OK OK