[Core] Split the factory into a new file