refactoring to support waiting for child services