Refactor FlywayMigrator to expose common behavior