Reorganize code for readability.