parameterized adaptor added. extern templates refactored