[minor] Reorganized code within files.