refactor Folder into a factory