Add an option to encode the context variables