Add wait groups and channels for concurrency.