Extracted migration function to seperate runnable
Made update of migrating atomic