I've implemented a system which requires runtime register/unregistering of a bean definition. But sometimes we need to register a few inner bean definitions as well.

Currently the code is...