Allow custom logic inside factories

...taking into account what has been set in the arguments