NEW: factory function instead of just plain hash of parameters