we need to think about if we need to optimize this part? (sorted TreeMap?)