Adding utility functions used by the migration script.