Refactored force calculation into a separate helper method