[4.2] Refactored Calculation Of Cost