Slight refactoring of wait for registration