remove dead code around cursors