Use of factory instead of direct instance