Reorganizing global auxiliary methods into local methods