Code cleanup, resign handling, Ko rule check