Reorganized the conditional structure.