Code re-organization part 2