Fix mistake in r80248 and restructure a bit