This function should be documented also (I think I know what it's for, but ideally I wouldn't have to guess).