Extract total value logic to private method