if someone else face this issue while calling another function in a factory constructor just make that function static