Code migration from version 1.