Using HashMap instead of regular Array in some cases (especially for streaming)