small code reordering