Updated API for delegation token

Extract to a method instead of copy pasting