This also needs documentation as it is difficult to understand what it is for without digging through the code.