Use protect head/end node to simplify operation logic