Cook:Fix old bugs and cleaning