Remove dummy function and replace reduce with better suited functions when possible