generate register func only for generators, check it by token
check with token, so that register func only gets greated for generators