move request call to a factory