The icon factory may try to read an empty list of icons
This is because the factory depends on multiple global state values which can be modified/cleared between 2 usages. And because the factory is used in thread or asynchronously.
So I think it will be better to rewrite it to be thread-safe by using immutable data structure.