intermediate refactoring: did violence to type system to make adapter wrapper work