cleaned up emmigration_test code