Export a function instead of module to avoid shared state.