LPS-38397 Adding company thread local initialization for scheduled publishing and small refactor