diff --git a/src/js/utilJS.js b/src/js/utilJS.js
index 42d96946662e0b2fcbbdd2f88eac1762c4a220d3..716a28b8bf4cc6e5c8bcf1e3f99227b82a1887d2 100644
--- a/src/js/utilJS.js
+++ b/src/js/utilJS.js
@@ -538,18 +538,48 @@ window.budgetLine = function(category, title) {
 		income = "$lastWeeksRepIncome";
 		expenses = "$lastWeeksRepExpenses";
 		profits = "$lastWeeksRepProfits";
+
+		return`<<if ${income}.${category} || ${expenses}.${category}>><tr>\
+		<td>${title}</td>\
+		<td><<print repFormat(${income}.${category})>></td>\
+		<td><<print repFormat(${expenses}.${category})>></td>\
+		<<set ${profits}.${category} = (${income}.${category} + ${expenses}.${category})>>\
+		<td><<print repFormat(${profits}.${category})>></td>\
+		</tr><</if>>`;
 	} else if (passage() === "Costs Budget") {
 		income = "$lastWeeksCashIncome";
 		expenses = "$lastWeeksCashExpenses";
 		profits = "$lastWeeksCashProfits";
+
+		return`<<if ${income}.${category} || ${expenses}.${category}>><tr>\
+		<td>${title}</td>\
+		<td>\
+			<<if (${income}.${category}) > 0>>\
+				@@.yellowgreen;<<print cashFormat(${income}.${category})>>@@\ /*please don't put a plus sign in front of income, it's not done on a budget sheet.  Safe to assume money is money unless it's in parenthesis or with a - sign.*/
+			<<else>>\
+				<<print cashFormat(${income}.${category})>>\
+			<</if>>\
+		</td>\
+		<td>\
+			<<if (${expenses}.${category}) < 0>>\
+				@@.red;-<<print cashFormat(Math.abs(${expenses}.${category}))>>\
+			<<else>>\
+				<<print cashFormat(${expenses}.${category})>>\
+			<</if>>\
+		</td>\
+		<<set ${profits}.${category} = (${income}.${category} + ${expenses}.${category})>>\
+		<td>\
+			<<if (${profits}.${category}) > 0>>\
+				@@.yellowgreen;<<print cashFormat(${profits}.${category})>>@@\
+			<<elseif (${profits}.${category}) < 0>>\
+				@@.red;-<<print cashFormat(Math.abs(${profits}.${category}))>>@@\
+			<<else>>\
+				<<print cashFormat(${profits}.${category})>>\
+			<</if>>\
+		</td>\
+		</tr><</if>>`;
 	}
-	return`<<if ${income}.${category} || ${expenses}.${category}>><tr>\
-	<td>${title}</td>\
-	<td><<print repFormat(${income}.${category})>></td>\
-	<td><<print repFormat(${expenses}.${category})>></td>\
-	<<set ${profits}.${category} = (${income}.${category} + ${expenses}.${category})>>\
-	<td><<print repFormat(${profits}.${category})>></td>\
-	</tr><</if>>`;
+	
 };
 
 window.massFormat = function(s) {
diff --git a/src/uncategorized/costsBudget.tw b/src/uncategorized/costsBudget.tw
index 792f8ff24d8ca4dd74c41ca2fd2819a6a970e0fc..32c5c48fb818f34dfe83b8dc94f3a316856e880d 100644
--- a/src/uncategorized/costsBudget.tw
+++ b/src/uncategorized/costsBudget.tw
@@ -47,2165 +47,219 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){
 		<th>Expense</th>
 		<th>Totals</th>
 	</tr>
+	
+	<<print budgetLine("whore", "Whores")>>
 
-	<<if $lastWeeksCashIncome.whore || $lastWeeksCashExpenses.whore>> /* If it's not 0, it will return true. */
-		<tr>
-			<td>Whores</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.whore) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.whore))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.whore))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.whore) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.whore)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.whore))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.whore = ($lastWeeksCashIncome.whore + $lastWeeksCashExpenses.whore)>>
-				<<if $lastWeeksCashProfits.whore > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.whore))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.whore) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.whore))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.whore)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("rest", "Resting")>>
 
-	<<if $lastWeeksCashIncome.rest || $lastWeeksCashExpenses.rest>>
-		<tr>
-			<td>Resting</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.rest) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.rest))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.rest))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.rest) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.rest)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.rest))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.rest = ($lastWeeksCashIncome.rest + $lastWeeksCashExpenses.rest)>>
-				<<if $lastWeeksCashProfits.rest > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.rest))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.rest) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.rest))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.rest)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("houseServant", "House servants")>>
 
-	<<if $lastWeeksCashIncome.houseServant || $lastWeeksCashExpenses.houseServant>>
-		<tr>
-			<td>House servants</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.houseServant) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.houseServant))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.houseServant))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.houseServant) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.houseServant)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.houseServant))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.houseServant = ($lastWeeksCashIncome.houseServant + $lastWeeksCashExpenses.houseServant)>>
-				<<if $lastWeeksCashProfits.houseServant > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.houseServant))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.houseServant) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.houseServant))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.houseServant)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("confined", "Confined")>>
 
-	<<if $lastWeeksCashIncome.confined || $lastWeeksCashExpenses.confined>>
-		<tr>
-			<td>Confined</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.confined) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.confined))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.confined))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.confined) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.confined)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.confined))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.confined = ($lastWeeksCashIncome.confined + $lastWeeksCashExpenses.confined)>>
-				<<if $lastWeeksCashProfits.confined > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.confined))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.confined) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.confined))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.confined)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.publicServant || $lastWeeksCashExpenses.publicServant>>
-		<tr>
-			<td>Public servants</td>
-			<td>
-				<<if $lastWeeksCashIncome.publicServant > 0>>
-					@@.green;$lastWeeksCashIncome.publicServant@@
-				<<else>>
-					$lastWeeksCashIncome.publicServant
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.publicServant) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.publicServant)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.publicServant))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.publicServant = ($lastWeeksCashIncome.publicServant + $lastWeeksCashExpenses.publicServant)>>
-				<<if $lastWeeksCashProfits.publicServant > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.publicServant))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.publicServant) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.publicServant))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.publicServant)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.classes || $lastWeeksCashExpenses.classes>>
-		<tr>
-			<td>Classes</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.classes) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.classes))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.classes))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.classes) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.classes)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.classes))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.classes = ($lastWeeksCashIncome.classes + $lastWeeksCashExpenses.classes)>>
-				<<if $lastWeeksCashProfits.classes > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.classes))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.classes) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.classes))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.classes)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("publicServant", "Public servants")>>
 
+	<<print budgetLine("classes", "Classes")>>
 
-	<<if $lastWeeksCashIncome.milked || $lastWeeksCashExpenses.milked>>
-		<tr>
-			<td>Milked</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.milked) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.milked))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.milked))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.milked) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.milked)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.milked))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.milked = ($lastWeeksCashIncome.milked + $lastWeeksCashExpenses.milked)>>
-				<<if $lastWeeksCashProfits.milked > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.milked))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.milked) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.milked))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.milked)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("milked", "Milked")>>
 
-	<<if $lastWeeksCashIncome.gloryhole || $lastWeeksCashExpenses.gloryhole>>
-		<tr>
-			<td>Gloryhole</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.gloryhole) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryhole))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryhole))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.gloryhole) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.gloryhole)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.gloryhole))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.gloryhole = ($lastWeeksCashIncome.gloryhole + $lastWeeksCashExpenses.gloryhole)>>
-				<<if $lastWeeksCashProfits.gloryhole > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryhole))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.gloryhole) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryhole))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.gloryhole)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("gloryhole", "Gloryhole")>>
 
 	<tr>
-		<h2>Structures</h2>		/* TODO: using h2s doesn't fit in with the rest of the game */
+		<h2>Structures</h2>
 	</tr>
 
-	<<if $lastWeeksCashIncome.brothel || $lastWeeksCashExpenses.brothel>>
-		<tr>
-			<td>[[$brothelNameCaps|Brothel][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($brothelSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.brothel) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothel))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothel))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.brothel) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.brothel)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.brothel))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.brothel = ($lastWeeksCashIncome.brothel + $lastWeeksCashExpenses.brothel)>>
-				<<if $lastWeeksCashProfits.brothel > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothel))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.brothel) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothel))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.brothel)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("brothel", "[[$brothelNameCaps|Brothel][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($brothelSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.whoreBrothel || $lastWeeksCashExpenses.whoreBrothel>> /* If it's not 0, it will return true. */
-		<tr>
-			<td>Brothel whores</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.whoreBrothel) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.whoreBrothel))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.whoreBrothel))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.whoreBrothel) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.whoreBrothel)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.whoreBrothel))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.whoreBrothel = ($lastWeeksCashIncome.whoreBrothel + $lastWeeksCashExpenses.whoreBrothel)>>
-				<<if $lastWeeksCashProfits.whoreBrothel > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.whoreBrothel))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.whoreBrothel) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.whoreBrothel))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.whoreBrothel)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("whoreBrothel", "Brothel whores")>>
 
-	<<if $lastWeeksCashIncome.brothelAds || $lastWeeksCashExpenses.brothelAds>>
-		<tr>
-			<td>[[Brothel ads|Brothel Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] also increase the income of whoring slaves in "jobs."</td>	/* TODO: this is also weird */
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.brothelAds) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothelAds))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.brothelAds))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.brothelAds) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.brothelAds)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.brothelAds))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.brothelAds = ($lastWeeksCashIncome.brothelAds + $lastWeeksCashExpenses.brothelAds)>>
-				<<if $lastWeeksCashProfits.brothelAds > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothelAds))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.brothelAds) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.brothelAds))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.brothelAds)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("brothelAds", "[[Brothel ads|Brothel Advertisement][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] also increase the income of whoring slaves in \"jobs.\"")>>
 
 	<<if $brothel > 0>>
 		<br>
 	<</if>>
 
-	<<if $lastWeeksCashIncome.club || $lastWeeksCashExpenses.club>>
-		<tr>
-			<td>[[$clubNameCaps|Club][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clubSlaves slaves)</td>
-			<td>
-				<<if $lastWeeksCashIncome.club > 0>>
-					@@.green;$lastWeeksCashIncome.club@@
-				<<else>>
-					$lastWeeksCashIncome.club
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.club) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.club)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.club))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.club = ($lastWeeksCashIncome.club + $lastWeeksCashExpenses.club)>>
-				<<if $lastWeeksCashProfits.club > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.club))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.club) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.club))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.club)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("club", "[[$clubNameCaps|Club][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($clubSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.clubAds || $lastWeeksCashExpenses.clubAds>>
-		<tr>
-			<td>[[Club ads|Club Advertisement][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.clubAds) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.clubAds))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.clubAds))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.clubAds) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.clubAds)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.clubAds))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.clubAds = ($lastWeeksCashIncome.clubAds + $lastWeeksCashExpenses.clubAds)>>
-				<<if $lastWeeksCashProfits.clubAds > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.clubAds))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.clubAds) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.clubAds))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.clubAds)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("clubAds", "[[Club ads|Club Advertisement][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]")>>
 
 	<<if $club > 0>>
 		<br>
 	<</if>>
 
-	<<if $lastWeeksCashIncome.arcade || $lastWeeksCashExpenses.arcade>>
-	<tr>
-		<td>[[$arcadeNameCaps|Arcade][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($arcadeSlaves slaves)</td>
-		<td>
-			<<if Math.trunc($lastWeeksCashIncome.arcade) > 0>>
-				@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.arcade))>>@@
-			<<else>>
-				<<print cashFormat(Math.trunc($lastWeeksCashIncome.arcade))>>
-			<</if>>
-		</td>
-		<td>
-			<<if Math.trunc($lastWeeksCashExpenses.arcade) < 0>>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.arcade)))>>@@
-			<<else>>
-				<<print cashFormat(Math.trunc($lastWeeksCashExpenses.arcade))>>
-			<</if>>
-		</td>
-		<td>
-			<<set $lastWeeksCashProfits.arcade = ($lastWeeksCashIncome.arcade + $lastWeeksCashExpenses.arcade)>>
-			<<if $lastWeeksCashProfits.arcade > 0>>
-				@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.arcade))>>@@
-			<<else>>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.arcade)))>>@@
-			<</if>>
-		</td>
-	</tr>
-	<</if>>
+	<<print budgetLine("arcade", "[[$arcadeNameCaps|Arcade][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($arcadeSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.gloryholeArcade || $lastWeeksCashExpenses.gloryholeArcade>>
-		<tr>
-			<td>Arcade slaves</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.gloryholeArcade) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryholeArcade))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.gloryholeArcade))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.gloryholeArcade) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.gloryholeArcade)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.gloryholeArcade))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.gloryholeArcade = ($lastWeeksCashIncome.gloryholeArcade + $lastWeeksCashExpenses.gloryholeArcade)>>
-				<<if $lastWeeksCashProfits.gloryholeArcade > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryholeArcade))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.gloryholeArcade) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.gloryholeArcade))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.gloryholeArcade)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("gloryholeArcade", "Arcade slaves")>>
 
 	<<if $arcade > 0>>
 		<br>
 	<</if>>
 
-
-	<<if $lastWeeksCashIncome.dairy || $lastWeeksCashExpenses.dairy>>
-		<tr>
-			<td>[[$dairyNameCaps|Dairy][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($dairySlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.dairy) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.dairy))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.dairy))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.dairy) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.dairy)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.dairy))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.dairy = ($lastWeeksCashIncome.dairy + $lastWeeksCashExpenses.dairy)>>
-				<<if $lastWeeksCashProfits.dairy > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.dairy))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.dairy) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.dairy))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.dairy)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.milkedDairy || $lastWeeksCashExpenses.milkedDairy>>
-		<tr>
-			<td>Dairy cows</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.milkedDairy) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.milkedDairy))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.milkedDairy))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.milkedDairy) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.milkedDairy)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.milkedDairy))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.milkedDairy = ($lastWeeksCashIncome.milkedDairy + $lastWeeksCashExpenses.milkedDairy)>>
-				<<if $lastWeeksCashProfits.milkedDairy > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.milkedDairy))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.milkedDairy) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.milkedDairy))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.milkedDairy)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("dairy", "[[$dairyNameCaps|Dairy][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($dairySlaves slaves)")>>
+	
+	<<print budgetLine("milkedDairy", "Dairy cows")>>
 
 	<<if $dairy > 0>>
 		<br>
 	<</if>>
 
-	<<if $lastWeeksCashIncome.servantsQuarters || $lastWeeksCashExpenses.servantsQuarters>>
-		<tr>
-			<td>[[Servants' Quarters][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($servantsQuartersSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.servantsQuarters) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.servantsQuarters))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.servantsQuarters))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.servantsQuarters) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.servantsQuarters)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.servantsQuarters))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.servantsQuarters = ($lastWeeksCashIncome.servantsQuarters + $lastWeeksCashExpenses.servantsQuarters)>>
-				<<if $lastWeeksCashProfits.servantsQuarters > 0>>
-					@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashProfits.servantsQuarters))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.servantsQuarters) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.servantsQuarters))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.servantsQuarters)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("servantsQuarters", "[[Servants' Quarters][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($servantsQuartersSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.masterSuite || $lastWeeksCashExpenses.masterSuite>>
-		<tr>
-			<td>[[Master Suite][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($masterSuiteSlaves slaves)</td>
-			<td>
-				<<if $lastWeeksCashIncome.masterSuite > 0>>
-					@@.green;$lastWeeksCashIncome.masterSuite@@
-				<<else>>
-					$lastWeeksCashIncome.masterSuite
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.masterSuite) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.masterSuite)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.masterSuite))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.masterSuite = ($lastWeeksCashIncome.masterSuite + $lastWeeksCashExpenses.masterSuite)>>
-				<<if $lastWeeksCashProfits.masterSuite > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.masterSuite))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.masterSuite) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.masterSuite))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.masterSuite)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("masterSuite", "[[Master Suite][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($masterSuiteSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.school || $lastWeeksCashExpenses.school>>
-		<tr>
-			<td>[[$schoolroomNameCaps|Schoolroom][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($schoolroomSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.school) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.school))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.school))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.school) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.school)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.school))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.school = ($lastWeeksCashIncome.school + $lastWeeksCashExpenses.school)>>
-				<<if $lastWeeksCashProfits.school > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.school))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.school) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.school))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.school)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("school", "[[$schoolroomNameCaps|Schoolroom][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($schoolroomSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.spa || $lastWeeksCashExpenses.spa>>
-		<tr>
-			<td>[[$spaNameCaps|Spa][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($spaSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.spa) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.spa))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.spa))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.spa) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.spa)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.spa))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.spa = ($lastWeeksCashIncome.spa + $lastWeeksCashExpenses.spa)>>
-				<<if $lastWeeksCashProfits.spa > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.spa))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.spa) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.spa))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.spa)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("spa", "[[$spaNameCaps|Spa][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($spaSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.clinic || $lastWeeksCashExpenses.clinic>>
-		<tr>
-			<td>[[$clinicNameCaps|Clinic][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($clinicSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.clinic) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.clinic))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.clinic))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.clinic) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.clinic)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.clinic))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.clinic = ($lastWeeksCashIncome.clinic + $lastWeeksCashExpenses.clinic)>>
-				<<if $lastWeeksCashProfits.clinic > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.clinic))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.clinic) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.clinic))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.clinic)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("clinic", "[[$clinicNameCaps|Clinic][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($clinicSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.cellblock || $lastWeeksCashExpenses.cellblock>>
-		<tr>
-			<td>[[$cellblockNameCaps|Cellblock][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($cellblockSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.cellblock) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.cellblock))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.cellblock))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.cellblock) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.cellblock)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.cellblock))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.cellblock = ($lastWeeksCashIncome.cellblock + $lastWeeksCashExpenses.cellblock)>>
-				<<if $lastWeeksCashProfits.cellblock > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.cellblock))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.cellblock) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.cellblock))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.cellblock)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("cellblock", "[[$cellblockNameCaps|Cellblock][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($cellblockSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.lab || $lastWeeksCashExpenses.lab>>
-		<tr>
-			<td>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] maintenance</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.lab) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.lab))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.lab))>>
-				<</if>>
-			</td>
-			<td>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.lab)))>>@@
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.lab = ($lastWeeksCashIncome.lab + $lastWeeksCashExpenses.lab)>>
-				<<if $lastWeeksCashProfits.lab > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.lab))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.lab) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.lab))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.lab)))>>@@
-				<</if>>
-			</td>
-		</tr>
+	<<print budgetLine("lab", "[[Research Lab][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] maintenance")>>
 
-		<<if $researchLab.hired != 0>>
-			<tr>
-				<td><i>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($researchLab.hired scientists)</i></td>
-				<td></td>
-				<td><i>@@.red;-<<print cashFormat(Math.trunc(300*$researchLab.hired))>>@@</i></td>
-				<td><i>@@.red;-<<print cashFormat(Math.abs(Math.trunc(300*$researchLab.hired)))>>@@</i></td>
-			</tr>
-		<</if>>
-		<<if $researchLab.menials != 0>>
-			<tr>
-				<td><i>[[Research Lab][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($researchLab.menials menial slaves)</i></td>
-				<td></td>
-				<td><i>@@.red;-+<<print cashFormat(Math.trunc(100*$researchLab.menials))>>@@</i></td>
-				<td><i>@@.red;-<<print cashFormat(Math.abs(Math.trunc(100*$researchLab.menials)))>>@@</i></td>
-			</tr>
-		<</if>>
-	<</if>>
+	<<print budgetLine("incubator", "[[$incubatorNameCaps|Incubator][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($incubatorSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.incubator || $lastWeeksCashExpenses.incubator>>
-		<tr>
-			<td>[[$incubatorNameCaps|Incubator][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($incubatorSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.incubator) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.incubator))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.incubator))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.incubator) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.incubator)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.incubator))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.incubator = ($lastWeeksCashIncome.incubator + $lastWeeksCashExpenses.incubator)>>
-				<<if $lastWeeksCashProfits.incubator > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.incubator))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.incubator) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.incubator))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.incubator)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("nursery", "[[$nurseryNameCaps|Nursery][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($nurserySlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.nursery || $lastWeeksCashExpenses.nursery>>
-		<tr>
-			<td>[[$nurseryNameCaps|Nursery][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($nurserySlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.nursery) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.nursery))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.nursery))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.nursery) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.nursery)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.nursery))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.nursery = ($lastWeeksCashIncome.nursery + $lastWeeksCashExpenses.nursery)>>
-				<<if $lastWeeksCashProfits.nursery > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.nursery))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.nursery) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.nursery))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.nursery)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("farmyard", "[[$farmyardNameCaps|Farmyard][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($farmyardSlaves slaves)")>>
 
-	<<if $lastWeeksCashIncome.farmyard || $lastWeeksCashExpenses.farmyard>>
-		<tr>
-			<td>[[$farmyardNameCaps|Farmyard][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($farmyardSlaves slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.farmyard) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.farmyard))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.farmyard))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.farmyard) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.farmyard)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.farmyard))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.farmyard = ($lastWeeksCashIncome.farmyard + $lastWeeksCashExpenses.farmyard)>>
-				<<if $lastWeeksCashProfits.farmyard > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.farmyard))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.farmyard) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.farmyard))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.farmyard)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.pit || $lastWeeksCashExpenses.pit>>
-		<tr>
-			<td>[[$pitNameCaps|Pit][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($fighterIDs.length slaves)</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.pit) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.pit))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.pit))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.pit) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.pit)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.pit))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.pit = ($lastWeeksCashIncome.pit + $lastWeeksCashExpenses.pit)>>
-				<<if $lastWeeksCashProfits.pit > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.pit))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.pit) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.pit))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.pit)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("pit", "[[$pitNameCaps|Pit][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($fighterIDs.length slaves)")>>
 
-	<<if $lastWeeksCashIncome.environment || $lastWeeksCashExpenses.environment>>
-		<tr>
-			<td>Environment</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.environment) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.environment))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.environment))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.environment) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.environment)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.environment))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.environment = ($lastWeeksCashIncome.environment + $lastWeeksCashExpenses.environment)>>
-				<<if $lastWeeksCashProfits.environment > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.environment))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.environment) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.environment))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.environment)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("environment", "Environment")>>
 
-	<<if $lastWeeksCashIncome.weather || $lastWeeksCashExpenses.weather>>	/* TODO: this doesn't fit in */
-		<tr>
-			<td>
-				<<if $lastWeeksCashExpenses.weather < 0 && $weatherCladding == 0>>
-					Weather is causing @@.red;expensive damage.@@  Consider a protective [[upgrade|Manage Arcology][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]].
+	<<print budgetLine("weather",
+				"<<if $lastWeeksCashExpenses.weather < 0 && $weatherCladding == 0>>
+					Weather is causing @@.red;expensive damage.@@  Consider a protective [[upgrade|Manage Arcology][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]].
 				<<else>>
 					Weather
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.weather) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.weather))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.weather))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.weather) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.weather)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.weather))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.weather = ($lastWeeksCashIncome.weather + $lastWeeksCashExpenses.weather)>>
-				<<if $lastWeeksCashProfits.weather > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.weather))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.weather) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.weather))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.weather)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
+				<</if>>")>>
 
 	<tr>
 		<h2>Slaves</h2>
 	</tr>
 
-	<tr>
-		<td>[[Slave maintenance|Costs Report Slaves][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] ($slaves.length slaves)</td>
-		<td>
-			<<if Math.trunc($lastWeeksCashIncome.slaveUpkeep) > 0>>
-				@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveUpkeep))>>@@
-			<<else>>
-				<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveUpkeep))>>
-			<</if>>
-		</td>
-		<td>
-			<<if Math.trunc($lastWeeksCashExpenses.slaveUpkeep) < 0>>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.slaveUpkeep)))>>@@
-			<<else>>
-				<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveUpkeep))>>
-			<</if>>
-		</td>
-		<td>
-			<<set $lastWeeksCashProfits.slaveUpkeep = ($lastWeeksCashIncome.slaveUpkeep + $lastWeeksCashExpenses.slaveUpkeep)>>
-			<<if $lastWeeksCashProfits.slaveUpkeep > 0>>
-				@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveUpkeep))>>@@
-			<<else>>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.slaveUpkeep)))>>@@
-			<</if>>
-		</td>
-	</tr>
+	<<print budgetLine("slaveUpkeep", "[[Slave maintenance|Costs Report Slaves][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] ($slaves.length slaves)")>>
 
-	<<if $lastWeeksCashIncome.extraMilk || $lastWeeksCashExpenses.extraMilk>>
-		<tr>
-			<td>Extra milk</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.extraMilk) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.extraMilk))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.extraMilk))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.extraMilk) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.extraMilk)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.extraMilk))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.extraMilk = ($lastWeeksCashIncome.extraMilk + $lastWeeksCashExpenses.extraMilk)>>
-				<<if $lastWeeksCashProfits.extraMilk > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.extraMilk))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.extraMilk) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.extraMilk))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.extraMilk)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("extraMilk", "Extra milk")>>
 
-	<<if $lastWeeksCashIncome.slaveTransfer || $lastWeeksCashExpenses.slaveTransfer>>
-		<tr>
-			<td>Selling/buying major slaves</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.slaveTransfer) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.slaveTransfer) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.slaveTransfer)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.slaveTransfer = ($lastWeeksCashIncome.slaveTransfer + $lastWeeksCashExpenses.slaveTransfer)>>
-				<<if $lastWeeksCashProfits.slaveTransfer > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.slaveTransfer) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveTransfer))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.slaveTransfer)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("slaveTransfer", "Selling/buying major slaves")>>
 
-	<<if $lastWeeksCashIncome.menialTransfer || $lastWeeksCashExpenses.menialTransfer>>
-		<tr>
-			<td>Menials: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.menialTransfer) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTransfer))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.menialTransfer) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.menialTransfer)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.menialTransfer = ($lastWeeksCashIncome.menialTransfer + $lastWeeksCashExpenses.menialTransfer)>>
-				<<if $lastWeeksCashProfits.menialTransfer > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTransfer))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.menialTransfer) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTransfer))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.menialTransfer)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("menialTransfer", "Menials: [[Assistant's|Personal assistant options][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] flipping")>>
 
-	<<if $lastWeeksCashIncome.fuckdollsTransfer || $lastWeeksCashExpenses.fuckdollsTransfer>>
-		<tr>
-			<td>Fuckdolls: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.fuckdollsTransfer) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdollsTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckdollsTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.fuckdollsTransfer = ($lastWeeksCashIncome.fuckdollsTransfer + $lastWeeksCashExpenses.fuckdollsTransfer)>>
-				<<if $lastWeeksCashProfits.fuckdollsTransfer > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.fuckdollsTransfer) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.fuckdollsTransfer)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("fuckdollsTransfer", "Fuckdolls: [[Assistant's|Personal assistant options][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] flipping")>>
 
-	<<if $lastWeeksCashIncome.menialBioreactorsTransfer || $lastWeeksCashExpenses.menialBioreactorsTransfer>>
-		<tr>
-			<td>Bioreactors: [[Assistant's|Personal assistant options][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] flipping</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.menialBioreactorsTransfer) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactorsTransfer))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactorsTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.menialBioreactorsTransfer) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.menialBioreactorsTransfer)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialBioreactorsTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.menialBioreactorsTransfer = ($lastWeeksCashIncome.menialBioreactorsTransfer + $lastWeeksCashExpenses.menialBioreactorsTransfer)>>
-				<<if $lastWeeksCashProfits.menialBioreactorsTransfer > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.menialBioreactorsTransfer)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("menialBioreactorsTransfer", "Bioreactors: [[Assistant's|Personal assistant options][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] flipping")>>
 
-	<<if $lastWeeksCashIncome.babyTransfer || $lastWeeksCashExpenses.babyTransfer>>
-		<tr>
-			<td>Selling/buying babies</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.babyTransfer) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.babyTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.babyTransfer) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.babyTransfer)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.babyTransfer))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.babyTransfer = ($lastWeeksCashIncome.babyTransfer + $lastWeeksCashExpenses.babyTransfer)>>
-				<<if $lastWeeksCashProfits.babyTransfer > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.babyTransfer) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.babyTransfer))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.babyTransfer)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("babyTransfer", "Selling/buying babies")>>
 
-	<<if ($lastWeeksCashIncome.menialTrades) || ($lastWeeksCashExpenses.menialTrades)>>
-		<tr>
-			<td>Menials: labor</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.menialTrades) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTrades))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialTrades))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.menialTrades) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.menialTrades)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialTrades))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.menialTrades = ($lastWeeksCashIncome.menialTrades + $lastWeeksCashExpenses.menialTrades)>>
-				<<if $lastWeeksCashProfits.menialTrades > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTrades))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.menialTrades) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialTrades))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.menialTrades)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("menialTrades", "Menials: labor")>>
 
-	<<if $lastWeeksCashIncome.fuckdolls || $lastWeeksCashExpenses.fuckdolls>>
-		<tr>
-			<td>Fuckdolls</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.fuckdolls) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdolls))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.fuckdolls))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.fuckdolls) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.fuckdolls)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fuckdolls))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.fuckdolls = ($lastWeeksCashIncome.fuckdolls + $lastWeeksCashExpenses.fuckdolls)>>
-				<<if $lastWeeksCashProfits.fuckdolls > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdolls))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.fuckdolls) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.fuckdolls))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.fuckdolls)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("fuckdolls", "Fuckdolls")>>
 
-	<<if ($lastWeeksCashIncome.menialBioreactors) || ($lastWeeksCashExpenses.menialBioreactors)>>
-		<tr>
-			<td>Menials: bioreactors</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.menialBioreactors) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactors))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialBioreactors))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.menialBioreactors) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.menialBioreactors)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialBioreactors))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.menialBioreactors = ($lastWeeksCashIncome.menialBioreactors + $lastWeeksCashExpenses.menialBioreactors)>>
-				<<if $lastWeeksCashProfits.menialBioreactors > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactors))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.menialBioreactors) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialBioreactors))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.menialBioreactors)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("menialBioreactors", "Menials: bioreactors")>>
 
-	<<if $lastWeeksCashIncome.porn || $lastWeeksCashExpenses.porn>>
-		<tr>
-			<td>Porn</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.porn) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.porn))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.porn))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.porn) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.porn)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.porn))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.porn = ($lastWeeksCashIncome.porn + $lastWeeksCashExpenses.porn)>>
-				<<if $lastWeeksCashProfits.porn > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.porn))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.porn) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.porn))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.porn)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("porn", "Porn")>>
 
-	<<if $lastWeeksCashIncome.recruiter || $lastWeeksCashExpenses.recruiter>>
-		<tr>
-			<td>Recruiter</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.recruiter) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.recruiter))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.recruiter))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.recruiter) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.recruiter)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.recruiter))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.recruiter = ($lastWeeksCashIncome.recruiter + $lastWeeksCashExpenses.recruiter)>>
-				<<if $lastWeeksCashProfits.recruiter > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.recruiter))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.recruiter) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.recruiter))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.recruiter)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("recruiter", "Recruiter")>>
 
-	<<if $lastWeeksCashIncome.menialRetirement || $lastWeeksCashExpenses.menialRetirement>>
-		<tr>
-			<td>Menials retiring</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.menialRetirement) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialRetirement))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.menialRetirement))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.menialRetirement) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.menialRetirement)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.menialRetirement))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.menialRetirement = ($lastWeeksCashIncome.menialRetirement + $lastWeeksCashExpenses.menialRetirement)>>
-				<<if $lastWeeksCashProfits.menialRetirement > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialRetirement))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.menialRetirement) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.menialRetirement))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.menialRetirement)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("menialRetirement", "Menials retiring")>>
 
-	<<if $lastWeeksCashIncome.slaveMod || $lastWeeksCashExpenses.slaveMod>>
-		<tr>
-			<td>Slave modification</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.slaveMod) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveMod))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveMod))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.slaveMod) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.slaveMod)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveMod))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.slaveMod = ($lastWeeksCashIncome.slaveMod + $lastWeeksCashExpenses.slaveMod)>>
-				<<if $lastWeeksCashProfits.slaveMod > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveMod))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.slaveMod) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveMod))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.slaveMod)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.slaveSurgery || $lastWeeksCashExpenses.slaveSurgery>>
-		<tr>
-			<td>Slave surgery</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.slaveSurgery) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveSurgery))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.slaveSurgery))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.slaveSurgery) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.slaveSurgery)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.slaveSurgery))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.slaveSurgery = ($lastWeeksCashIncome.slaveSurgery + $lastWeeksCashExpenses.slaveSurgery)>>
-				<<if $lastWeeksCashProfits.slaveSurgery > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveSurgery))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.slaveSurgery) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.slaveSurgery))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.slaveSurgery)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("slaveMod", "Slave modification")>>
 
-	<<if $lastWeeksCashIncome.birth || $lastWeeksCashExpenses.birth>>
-		<tr>
-			<td>Slave surgery</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.birth) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.birth))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.birth))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.birth) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.birth)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.birth))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.birth = ($lastWeeksCashIncome.birth + $lastWeeksCashExpenses.birth)>>
-				<<if $lastWeeksCashProfits.birth > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.birth))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.birth) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.birth))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.birth)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("slaveSurgery", "Slave surgery")>>
 
+	<<print budgetLine("birth", "Slave surgery")>>
 
 	<tr>
 		<h2>Finance</h2>
 	</tr>
 
-	<<if $lastWeeksCashIncome.personalBusiness || $lastWeeksCashExpenses.personalBusiness>>
-		<tr>
-			<td>Personal business</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.personalBusiness) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalBusiness))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalBusiness))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.personalBusiness) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.personalBusiness)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.personalBusiness))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.personalBusiness = ($lastWeeksCashIncome.personalBusiness + $lastWeeksCashExpenses.personalBusiness)>>
-				<<if $lastWeeksCashProfits.personalBusiness > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalBusiness))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.personalBusiness) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalBusiness))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.personalBusiness)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("personalBusiness", "Personal business")>>
 
-	<tr>
-		<<if $girls == 3>>
-			<td>Since you are accustomed to luxury, your personal living expenses are:</td>
+	<<print budgetLine("personalLivingExpenses",
+		"<<if $girls == 3>>
+			Since you are accustomed to luxury, your personal living expenses are:
 		<<elseif $girls == 2>>
-			<td>Since you are used to living well, your personal living expenses are:</td>
+			Since you are used to living well, your personal living expenses are:
 		<<else>>
-			<td>Since you are used to a fairly normal life, your personal living expenses are:</td>
-		<</if>>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.personalLivingExpenses) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalLivingExpenses))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.personalLivingExpenses))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.personalLivingExpenses) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.personalLivingExpenses)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.personalLivingExpenses))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.personalLivingExpenses = ($lastWeeksCashIncome.personalLivingExpenses + $lastWeeksCashExpenses.personalLivingExpenses)>>
-				<<if $lastWeeksCashProfits.personalLivingExpenses > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalLivingExpenses))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.personalLivingExpenses) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.personalLivingExpenses))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.personalLivingExpenses)))>>@@
-				<</if>>
-			</td>
-	</tr>
-
-	<<if $lastWeeksCashIncome.PCtraining || $lastWeeksCashExpenses.PCtraining>>
-		<tr>
-			<td>Your training</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.PCtraining) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCtraining))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCtraining))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.PCtraining) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.PCtraining)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCtraining))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.PCtraining = ($lastWeeksCashIncome.PCtraining + $lastWeeksCashExpenses.PCtraining)>>
-				<<if $lastWeeksCashProfits.PCtraining > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.PCtraining) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.PCtraining)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.PCmedical || $lastWeeksCashExpenses.PCmedical>>
-		<tr>
-			<td>Your medical expenses</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.PCmedical) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCmedical))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCmedical))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.PCmedical) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.PCmedical)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCmedical))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.PCmedical = ($lastWeeksCashIncome.PCmedical + $lastWeeksCashExpenses.PCmedical)>>
-				<<if $lastWeeksCashProfits.PCmedical > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCmedical))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.PCmedical) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCmedical))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.PCmedical)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.PCskills || $lastWeeksCashExpenses.PCskills>>
-		<tr>
-			<td>Your skills</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.PCskills) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCskills))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCskills))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.PCskills) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.PCskills)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCskills))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.PCskills = ($lastWeeksCashIncome.PCskills + $lastWeeksCashExpenses.PCskills)>>
-				<<if $lastWeeksCashProfits.PCskills > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCskills))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.PCskills) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCskills))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.PCskills)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<tr>
-		<td>
-			Your rents
+			Since you are used to a fairly normal life, your personal living expenses are:
+		<</if>>")>>
+
+	<<print budgetLine("PCtraining", "<<if ($personalAttention == \"trading\")>>
+					[[Trading trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
+				<<elseif ($personalAttention == \"warfare\")>>
+					[[Warfare trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
+				<<elseif ($personalAttention == \"slaving\")>>
+					[[Slaving trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
+				<<elseif ($personalAttention == \"engineering\")>>
+					[[Engineering trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
+				<<elseif ($personalAttention == \"medicine\")>>
+					[[Medicine trainer|Personal Attention Select][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] fees
+				<</if>>")>>
+
+	<<print budgetLine("PCmedical", "Your medical expenses")>>
+
+	<<print budgetLine("PCskills", "Your skills")>>
+
+	<<print budgetLine("rents", "Your rents
 			<<if $lastWeeksCashExpenses.rents < 0>>
 				and bribes
-			<</if>>
-		</td>
-		<td>
-			<<if Math.trunc($lastWeeksCashIncome.rents) > 0>>
-				@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.rents))>>@@
-			<<else>>
-				<<print cashFormat(Math.trunc($lastWeeksCashIncome.rents))>>
-			<</if>>
-		</td>
-		<td>
-			<<if Math.trunc($lastWeeksCashExpenses.rents) < 0>>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.rents)))>>@@
-			<<else>>
-				<<print cashFormat(Math.trunc($lastWeeksCashExpenses.rents))>>
-			<</if>>
-		</td>
-		<td>
-			<<set $lastWeeksCashProfits.rents = ($lastWeeksCashIncome.rents + $lastWeeksCashExpenses.rents)>>
-			<<if $lastWeeksCashIncome.rents > 0>>
-				@@.yellowgreen;<<print cashFormat(Math.trunc($lastWeeksCashIncome.rents))>>@@
-			<<elseif Math.trunc($lastWeeksCashIncome.rents) == 0>>
-				<<print cashFormat(Math.trunc($lastWeeksCashIncome.rents))>>
-			<<else>>
-				@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashIncome.rents)))>>@@
-			<</if>>
-		</td>
-	</tr>
+			<</if>>")>>
 
-	<<if $lastWeeksCashIncome.stocks>>
-		<tr>
-			<td>Stock dividends on ($personalShares/<<print ($publicShares + $personalShares)>> shares).</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.stocks) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.stocks))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.stocks))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.stocks) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.stocks)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.stocks))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.stocks = ($lastWeeksCashIncome.stocks + $lastWeeksCashExpenses.stocks)>>
-				<<if $lastWeeksCashProfits.stocks > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocks))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.stocks) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocks))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.stocks)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("stocks", ">Stock dividends on ($personalShares/<<print ($publicShares + $personalShares)>> shares).")>>
 
-	<<if $lastWeeksCashIncome.stocksTraded|| $lastWeeksCashExpenses.stocksTraded>>
-		<tr>
-			<td>Stock trading</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.stocksTraded) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.stocksTraded))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.stocksTraded))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.stocksTraded) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.stocksTraded)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.stocksTraded))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.stocksTraded = ($lastWeeksCashIncome.stocksTraded + $lastWeeksCashExpenses.stocksTraded)>>
-				<<if $lastWeeksCashProfits.stocksTraded > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocksTraded))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.stocksTraded) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.stocksTraded))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.stocksTraded)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("stocksTraded", "Stock trading")>>
 
-	<<if $lastWeeksCashIncome.fines || $lastWeeksCashExpenses.fines>>
-		<tr>
-			<td>Fines</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.fines) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.fines))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.fines))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.fines) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.fines)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.fines))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.fines = ($lastWeeksCashIncome.fines + $lastWeeksCashExpenses.fines)>>
-				<<if $lastWeeksCashProfits.fines > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.fines))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.fines) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.fines))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.fines)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("fines", "Fines")>>
 
-	<<if $lastWeeksCashIncome.event || $lastWeeksCashExpenses.event>>
-		<tr>
-			<td>Events</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.event) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.event))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.event))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.event) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.event)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.event))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.event = ($lastWeeksCashIncome.event + $lastWeeksCashExpenses.event)>>
-				<<if $lastWeeksCashProfits.event > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.event))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.event) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.event))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.event)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("event", "Events")>>
 
-	<<if $lastWeeksCashIncome.war || $lastWeeksCashExpenses.war>>
-		<tr>
-			<td>Archology conflict</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.war) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.war))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.war))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.war) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.war)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.war))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.war = ($lastWeeksCashIncome.war + $lastWeeksCashExpenses.war)>>
-				<<if $lastWeeksCashProfits.war > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.war))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.war) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.war))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.war)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("war", "Archology conflict")>>
 
-	<<if $lastWeeksCashIncome.PCtraining || $lastWeeksCashExpenses.PCtraining>>
-		<tr>
-			<td>
-				<<if ($personalAttention == "trading")>>
-					[[Trading trainer|Personal Attention Select][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] fees
-				<<elseif ($personalAttention == "warfare")>>
-					[[Warfare trainer|Personal Attention Select][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] fees
-				<<elseif ($personalAttention == "slaving")>>
-					[[Slaving trainer|Personal Attention Select][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] fees
-				<<elseif ($personalAttention == "engineering")>>
-					[[Engineering trainer|Personal Attention Select][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] fees
-				<<elseif ($personalAttention == "medicine")>>
-					[[Medicine trainer|Personal Attention Select][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] fees
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.PCtraining) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCtraining))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.PCtraining))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.PCtraining) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.PCtraining)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.PCtraining))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.PCtraining = ($lastWeeksCashIncome.PCtraining + $lastWeeksCashExpenses.PCtraining)>>
-				<<if $lastWeeksCashProfits.PCtraining > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.PCtraining) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.PCtraining))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.PCtraining)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("capEx", "Capital expenses")>>
 
-	<<if $lastWeeksCashIncome.capEx || $lastWeeksCashExpenses.capEx>>
-		<tr>
-			<td>Capital expenses</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.capEx) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.capEx))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.capEx))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.capEx) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.capEx)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.capEx))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.capEx = ($lastWeeksCashIncome.capEx + $lastWeeksCashExpenses.capEx)>>
-				<<if $lastWeeksCashProfits.capEx > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.capEx))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.capEx) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.capEx))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.capEx)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.cheating || $lastWeeksCashExpenses.cheating>>
-		<tr>
-			<td>CHEATING</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.cheating) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.cheating))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.cheating))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.cheating) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.cheating)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.cheating))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.cheating = ($lastWeeksCashIncome.cheating + $lastWeeksCashExpenses.cheating)>>
-				<<if $lastWeeksCashProfits.cheating > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.cheating))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.cheating) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.cheating))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.cheating)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("cheating", "CHEATING")>>
 
 	<tr>
 		<h2>Policies</h2>
 	</tr>
 
-	<<if $lastWeeksCashIncome.policies || $lastWeeksCashExpenses.policies>>
-		<tr>
-			<td>[[Policies|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] and [[Edicts|edicts][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.policies) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.policies))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.policies))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.policies) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.policies)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.policies))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.policies = ($lastWeeksCashIncome.policies + $lastWeeksCashExpenses.policies)>>
-				<<if $lastWeeksCashProfits.policies > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.policies))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.policies) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.policies))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.policies)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $FSSpending != 0>>
-		<tr>
-			<td>[[Society shaping|Future Society][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.futureSocieties) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.futureSocieties))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.futureSocieties))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.futureSocieties) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.futureSocieties)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.futureSocieties))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.futureSocieties = ($lastWeeksCashIncome.futureSocieties + $lastWeeksCashExpenses.futureSocieties)>>
-				<<if $lastWeeksCashProfits.futureSocieties > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.futureSocieties))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.futureSocieties) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.futureSocieties))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.futureSocieties)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
-
-	<<if $lastWeeksCashIncome.schoolBacking || $lastWeeksCashExpenses.schoolBacking>>
-		<tr>
-			<td>
-				<<if $TSS.subsidize != 0>>[[The Slavegirl School|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus influence
-				<<elseif $GRI.subsidize != 0>>[[Growth Research Institute|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] subsidiary lab influence
-				<<elseif $SCP.subsidize != 0>>[[St. Claver Preparatory|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus influence
-				<<elseif $LDE.subsidize != 0>>[[L'Encole des Enculees|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus influence
-				<<elseif $TGA.subsidize != 0>>[[The Gymnasium-Academy|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus influence
-				<<elseif $TCR.subsidize != 0>>[[The Cattle Ranch|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus influence
-				<<elseif $HA.subsidize != 0>>[[Hippolyta Academy|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus influence
-				<<elseif $TFS.subsidize != 0>>[[The Futanari Sisters|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] community influence
-				<<elseif $TSS.schoolPresent == 1>>[[The Slavegirl School|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus upkeep
-				<<elseif $GRI.schoolPresent == 1>>[[Growth Research Institute|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] subsidiary lab upkeep
-				<<elseif $SCP.schoolPresent == 1>>[[St. Claver Preparatory|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus upkeep
-				<<elseif $LDE.schoolPresent == 1>>[[L'Encole des Enculees|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus upkeep
-				<<elseif $TGA.schoolPresent == 1>>[[The Gymnasium-Academy|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus upkeep
-				<<elseif $TCR.schoolPresent == 1>>[[The Cattle Ranch|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus upkeep
-				<<elseif $HA.schoolPresent == 1>>[[Hippolyta Academy|Policies][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]] branch campus upkeep
+	<<print budgetLine("policies", "[[Policies|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] and [[Edicts|edicts][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]")>>
+
+	<<print budgetLine("futureSocieties", "[[Society shaping|Future Society][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]")>>
+
+	<<print budgetLine("schoolBacking", 
+				"<<if $TSS.subsidize != 0>>[[The Slavegirl School|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
+				<<elseif $GRI.subsidize != 0>>[[Growth Research Institute|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] subsidiary lab influence
+				<<elseif $SCP.subsidize != 0>>[[St. Claver Preparatory|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
+				<<elseif $LDE.subsidize != 0>>[[L'Encole des Enculees|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
+				<<elseif $TGA.subsidize != 0>>[[The Gymnasium-Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
+				<<elseif $TCR.subsidize != 0>>[[The Cattle Ranch|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
+				<<elseif $HA.subsidize != 0>>[[Hippolyta Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus influence
+				<<elseif $TFS.subsidize != 0>>[[The Futanari Sisters|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] community influence
+				<<elseif $TSS.schoolPresent == 1>>[[The Slavegirl School|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
+				<<elseif $GRI.schoolPresent == 1>>[[Growth Research Institute|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] subsidiary lab upkeep
+				<<elseif $SCP.schoolPresent == 1>>[[St. Claver Preparatory|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
+				<<elseif $LDE.schoolPresent == 1>>[[L'Encole des Enculees|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
+				<<elseif $TGA.schoolPresent == 1>>[[The Gymnasium-Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
+				<<elseif $TCR.schoolPresent == 1>>[[The Cattle Ranch|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
+				<<elseif $HA.schoolPresent == 1>>[[Hippolyta Academy|Policies][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]] branch campus upkeep
 				<<else>> Unknown school expense
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.schoolBacking) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.schoolBacking))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.schoolBacking))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.schoolBacking) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.schoolBacking)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.schoolBacking))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.schoolBacking = ($lastWeeksCashIncome.schoolBacking + $lastWeeksCashExpenses.schoolBacking)>>
-				<<if $lastWeeksCashProfits.schoolBacking > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.schoolBacking))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.schoolBacking) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.schoolBacking))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.schoolBacking)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+				<</if>>")>>
 
-	<<if $citizenOrphanageTotal > 0>>
-		<tr>
-			<td>Education of $citizenOrphanageTotal of your slaves' children in citizen schools</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.citizenOrphanage) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.citizenOrphanage))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.citizenOrphanage))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.citizenOrphanage) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.citizenOrphanage)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.citizenOrphanage))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.citizenOrphanage = ($lastWeeksCashIncome.citizenOrphanage + $lastWeeksCashExpenses.citizenOrphanage)>>
-				<<if $lastWeeksCashProfits.citizenOrphanage > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.citizenOrphanage))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.citizenOrphanage) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.citizenOrphanage))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.citizenOrphanage)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("citizenOrphanage", "Education of $citizenOrphanageTotal of your slaves\' children in citizen schools")>>
 
-	<<if $privateOrphanageTotal > 0>>
-		<tr>
-			<td>Private tutelage of $privateOrphanageTotal of your slaves' children</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.privateOrphanage) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.privateOrphanage))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.privateOrphanage))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.privateOrphanage) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.privateOrphanage)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.privateOrphanage))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.privateOrphanage = ($lastWeeksCashIncome.privateOrphanage + $lastWeeksCashExpenses.privateOrphanage)>>
-				<<if $lastWeeksCashProfits.privateOrphanage > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.privateOrphanage))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.privateOrphanage) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.privateOrphanage))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.privateOrphanage)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("privateOrphanage", "Private tutelage of $privateOrphanageTotal of your slaves\' children")>>
 
-	<<if $mercenaries > 0>>
-		<tr>
-			<td>Security: [[$mercenariesTitle|Barracks][$nextButton = "Back to Budget", $nextLink = "Costs Budget"]]
+	<<print budgetLine("mercenaries", "Security: [[$mercenariesTitle|Barracks][$nextButton = \"Back to Budget\", $nextLink = \"Costs Budget\"]]
 			<<if $barracks>><<else>><br>//@@.red;Cost increased by the lack of an armory to house them.@@//<</if>>
-			<<if ($PC.warfare >= 100) || ($PC.career == "arcology owner")>><br>//Cost reduced by your @@.springgreen;mercenary contacts.@@//<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.mercenaries) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.mercenaries))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.mercenaries))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.mercenaries) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.mercenaries)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.mercenaries))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.mercenaries = ($lastWeeksCashIncome.mercenaries + $lastWeeksCashExpenses.mercenaries)>>
-				<<if $lastWeeksCashProfits.mercenaries > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.mercenaries))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.mercenaries) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.mercenaries))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.mercenaries)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+			<<if ($PC.warfare >= 100) || ($PC.career == \"arcology owner\")>><br>//Cost reduced by your @@.springgreen;mercenary contacts.@@//<</if>>")>>
 
-	<<if $lastWeeksCashIncome.securityExpansion || $lastWeeksCashExpenses.securityExpansion>>
-		<tr>
-			<td>Security expansion</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.securityExpansion) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.securityExpansion))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.securityExpansion))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.securityExpansion) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.securityExpansion)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.securityExpansion))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.securityExpansion = ($lastWeeksCashIncome.securityExpansion + $lastWeeksCashExpenses.securityExpansion)>>
-				<<if $lastWeeksCashProfits.securityExpansion > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.securityExpansion))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.securityExpansion) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.securityExpansion))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.securityExpansion)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("securityExpansion", "Security expansion")>>
 
-	<<if $lastWeeksCashIncome.specialForces || $lastWeeksCashExpenses.specialForces>>
-		<tr>
-			<td>Special forces</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashIncome.specialForces) > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.specialForces))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashIncome.specialForces))>>
-				<</if>>
-			</td>
-			<td>
-				<<if Math.trunc($lastWeeksCashExpenses.specialForces) < 0>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.specialForces)))>>@@
-				<<else>>
-					<<print cashFormat(Math.trunc($lastWeeksCashExpenses.specialForces))>>
-				<</if>>
-			</td>
-			<td>
-				<<set $lastWeeksCashProfits.specialForces = ($lastWeeksCashIncome.specialForces + $lastWeeksCashExpenses.specialForces)>>
-				<<if $lastWeeksCashProfits.specialForces > 0>>
-					@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.specialForces))>>@@
-				<<elseif Math.trunc($lastWeeksCashProfits.specialForces) == 0>>
-					<<print cashFormat(Math.trunc($lastWeeksCashProfits.specialForces))>>
-				<<else>>
-					@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.specialForces)))>>@@
-				<</if>>
-			</td>
-		</tr>
-	<</if>>
+	<<print budgetLine("specialForces", "Special forces")>>
+
+	<<print budgetLine("undermining", "Undermine political support for the nearby old world peacekeeping mission.")>>
 
-	<<if (def $peacekeepers) and ($peacekeepers != 0) >>
-		<<if $peacekeepers.undermining != 0>>
-			<tr>
-				<td>Undermine political support for the nearby old world peacekeeping mission.</td>
-				<td>
-					<<if Math.trunc($lastWeeksCashIncome.peacekeepers) > 0>>
-						@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashIncome.peacekeepers))>>@@
-					<<else>>
-						<<print cashFormat(Math.trunc($lastWeeksCashIncome.peacekeepers))>>
-					<</if>>
-				</td>
-				<td>
-					<<if Math.trunc($lastWeeksCashExpenses.peacekeepers) < 0>>
-						@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashExpenses.peacekeepers)))>>@@
-					<<else>>
-						<<print cashFormat(Math.trunc($lastWeeksCashExpenses.peacekeepers))>>
-					<</if>>
-				</td>
-				<td>
-					<<set $lastWeeksCashProfits.peacekeepers = ($lastWeeksCashIncome.peacekeepers + $lastWeeksCashExpenses.peacekeepers)>>
-					<<if $lastWeeksCashProfits.peacekeepers > 0>>
-						@@.yellowgreen;+<<print cashFormat(Math.trunc($lastWeeksCashProfits.peacekeepers))>>@@
-					<<else>>
-						@@.red;-<<print cashFormat(Math.abs(Math.trunc($lastWeeksCashProfits.peacekeepers)))>>@@
-					<</if>>
-				</td>
-			</tr>
-		<</if>>
-	<</if>>
 
 	<tr><td></td></tr>
 	<tr>
@@ -2291,10 +345,6 @@ for(var i = 0; i < State.variables.lastWeeksCashIncome.length; i++){
 
 <br>
 
-<table> /* long entries */
-
-
-</table>
 <</if>>
 
 <<if ndef $lastWeeksCashErrors>>