Refactor Process to Map and Reduce