Using Factory in tests