Revamp grant type factory as bundle friendly.