Refactor some code.Fix some bug.Add some log. Add some debug code.