refactoring to support passing of custom params to callback from adaptors