Refactored cost method and packages