DATAREDIS-253 - Avoid usage of deprecated API.

Changed usage of TypeFactory to the recommended API.