Modularized seneca and extractd xhr object creation to new function.