Refactored to semaphorify/mutexify