Intermediate commit- reorganizing code.