refactor code(1)