Some cleanup -- better control flow.