perf: don't create a hundred identical functions