New/old code split. Automatic data update added.