Refactor and Test DatabaseMigrator