small code reordering.