1.remove useless code
2.refactor the structure