Move code from ioc to mvc. And can support contextParams.