Created setContextFactory method