Added idgen as new context done function to replace wrapping idGen
Added idgen as new context done function to replace wrapping idGen