I would probably consider a ContextDefinitionCollection class to deal with multiple context and avoid conditional logic here. Also I'd inject the typed data manager instead of calling it from inside the method.