Code re-org and cleanup.