add without init-value of reduce and refactor