changed factory to reflection method