Now everithing should work as expected. One minor improvement in the error function for the factories.
I do expect a lot of errors in this merge, this will be review later on, please don't rebase into this one