finish refactor, need debug