make context a type of a function and fix etag