more cid refactor
debug cleanup