[JBTM-2203] jespers-perf-improvements

!BLACKTIE !QA_JTA !QA_JTS_JACORB !XTS
Also JH made the point that we could consider using lists here. The maps are only ever have a few entries so iterating a list might perform better than incurring the constant overhead of having to hash kesy to do a map lookup.