Split factory method into separate files.