1,refactor the code