Simplification of factory management
Created by: Gontran-Molotov
This PR simplifies/optimizes the management of factories by using dictionaries to store them instead of object lists.
Using dictionaries, the retrieval/update of factories is more straightforward as it does not require to loop over the list of objects.