get some control over subprocesses
some error handling
some refactoring