Why all the extra code here?