LPS-38283 Recovered factory pattern. Code style sync. Fix import deduplication.