remove array reduce code