Better testability for threading.