Reorganizing code for building