fix structure of factories