refactor factories file into folder