switch nudge functions to a factory function