Remove repeating code but concurrency working