refactored/modularized the update results function