Finished migration code