changed to capture request object from just key; various refactoring