use id() instead of alloc_id for invokers and tasks
refactoring