A cursor factory