Moved concurrency check code into separate library