local lib factory.