reducers and profiling code