code refactor:reverse linked list using iterate way