Reorganizing code for clarity.