Getting rid of System.exit() call in TaskDispatcher