Not sure if passing factory to all elements, that it creates is a good idea. But maybe other code in this PR will answer to my question.