Update of the code to meet the new Factory.
Merge remote-tracking branch 'origin/kotlin-master' into kotlin-master