test related stuff, refactoring, command line options