version without using factory