I understand you have been inspired by existing code but I <b>strongly</b> suggest to use an immutable map here.