Moved the code to use BatchFragments