Reorganizing code structure