Fix calendar factory to avoid using singleton.