Launched means that runtimes_ are not empty, and terminated means that the application instance is deleted. So there shouldn't a case when runtimes_.empty() == true. I would suggest remove the function.