Refactored signed_request-related code.