remove useless code
remove useless code and refactor