[Olena-patches] 4436: Do some refactoring for best future olena integration.