Improved migration to 4.0