Smarter group subfolder calculation