Clean up batch functions.