Moved logic of migration servers into a func