The application (the code) is not 100% well organized. Business logic is not 100% separated from UI logic. The answer "do refactoring first" is defenatelydefinitely a good answer. But in my case things are not 100% how they should be ideally be.
Actually, creating such shims requeresrequires much routine work. I have a feeling that this work is not necessary to be performed. I have a feeling that there is a ready solution for this problem...