Pass the id as well as the state to the cleanup functions

Signed-off-by: John Else <john.else@citrix.com>