code refactoring,including rename variable name and restructure