Revamp response type and token type factory as bundle friendly.