More eficient data migration code
Split db migration code