Extract displaying grouped items to separate function
Correctly handle empty directories
Do not show blank line when displaying empty directory