Adding a way to configure a context to factory function