This block is duplicated from above. Would be nicer for that not to be the case.