move aggregatedFolder computation into dedicated class and write more unit tests