I'd like to make sure @stdweird has reviewed this. Is the last line OK, i.e. doing this only once?