diff --git a/pygitweb/actions.py b/pygitweb/actions.py
index 846b3da..f012c9a 100644
--- a/pygitweb/actions.py
+++ b/pygitweb/actions.py
@@ -356,7 +356,7 @@ def git_summary(project: str, extra_rows: list[list[str]] | None = None) -> HTML
 		board_value = f'<a href="/board/create?project={proj_q}"{grey_style}>create board</a>'
 
 	rows: list[list[str]] = [
-		["Owner", esc_html(owner)],
+		["Owner", esc_html(owner) or ""],
 		[
 			(
 				'<label for="summary-ref-select">Ref</label> '
diff --git a/pygitweb/api/action.py b/pygitweb/api/action.py
index bb34513..de0c346 100644
--- a/pygitweb/api/action.py
+++ b/pygitweb/api/action.py
@@ -1,12 +1,15 @@
 from fastapi import Request
+
 from pygitweb.api.project import Project
 
-class Action(object):
-    """
-    Action: A per-project action provided by a plugin.
-    """
-    def action_name(self) -> str:
-        return "base-action"
-    
-    def action(self, project: Project, user: request: Request = None) -> None:
-        raise NotImplementedError(f"Action {self.action_name()} is not implemented")
+
+class Action:
+	"""
+	Action: A per-project action provided by a plugin.
+	"""
+
+	def action_name(self) -> str:
+		return "base-action"
+
+	def action(self, project: Project, req: Request = None) -> None:
+		raise NotImplementedError(f"Action {self.action_name()} is not implemented")
diff --git a/pygitweb/api/subpage.py b/pygitweb/api/subpage.py
index 70dfc34..0eee388 100644
--- a/pygitweb/api/subpage.py
+++ b/pygitweb/api/subpage.py
@@ -1,5 +1,3 @@
-
-
 class Subpage:
 	"""
 	Subpage: A per-project subpage provided by a plugin.
@@ -13,4 +11,3 @@ class Subpage:
 
 	def subpage_html(self, project: str) -> str | None:
 		return None
-
diff --git a/pygitweb/config.py b/pygitweb/config.py
index 35ed893..3dabf32 100644
--- a/pygitweb/config.py
+++ b/pygitweb/config.py
@@ -139,9 +139,3 @@ def get_loadavg() -> float:
 			return float(f.read().split()[0])
 	except (OSError, ValueError):
 		return 0.0
-
-
-def check_loadavg() -> None:
-	"""Raise 503 if load exceeds MAXLOAD."""
-	if settings.MAXLOAD is not None and get_loadavg() > settings.MAXLOAD:
-		raise RuntimeError("503:The load average on the server is too high")
diff --git a/pygitweb/main.py b/pygitweb/main.py
index c31b17b..93738e2 100644
--- a/pygitweb/main.py
+++ b/pygitweb/main.py
@@ -42,7 +42,7 @@ from pygitweb.actions import (
 from pygitweb.api.plugins.project_zip import ProjectZip
 from pygitweb.api.project import Project
 from pygitweb.api.subpage import Subpage
-from pygitweb.config import ACTIONS, check_loadavg, settings
+from pygitweb.config import ACTIONS, get_loadavg, settings
 from pygitweb.formatting import age_string, esc_html
 from pygitweb.git_helpers import git_get_references, git_get_type
 from pygitweb.projects import git_get_project_owner, git_get_projects_list
@@ -56,7 +56,7 @@ from pygitweb.tasks import (
 )
 from pygitweb.templates_env import POSTAMBLE, PREAMBLE, env
 from pygitweb.timeline_cache import get_all_timeline_events, warm_timeline_cache_async
-from pygitweb.validation import is_valid_action, is_valid_pathname, is_valid_project
+from pygitweb.validation import is_valid_pathname, is_valid_project
 
 try:
 	from pygitweb_pytesthtml.subpage_pytesthtml import SubpagePytestHtml
@@ -148,7 +148,8 @@ async def warm_activity_timeline_cache() -> None:
 @app.middleware("http")
 async def loadavg_middleware(request: Request, call_next):
 	try:
-		check_loadavg()
+		if settings.MAXLOAD is not None and get_loadavg() > settings.MAXLOAD:
+			raise RuntimeError("503:The load average on the server is too high")
 	except RuntimeError as e:
 		msg = str(e)
 		if msg.startswith("503:"):
@@ -171,26 +172,6 @@ def _validate_project(project: str | None) -> str:
 	return project
 
 
-def _format_activity_time(epoch: int) -> str:
-	try:
-		age_seconds = datetime.now(UTC).timestamp() - float(epoch)
-		if age_seconds <= 0:
-			return "right now"
-		return age_string(age_seconds)
-	except (ValueError, OSError):
-		return ""
-
-
-def _truncate_activity_description(description: str | None, max_len: int = 80) -> str:
-	if not description:
-		return ""
-	if "\n" in description:
-		return description.splitlines()[0][:max_len].rstrip() + "..."
-	if len(description) > max_len:
-		return description[:max_len].rstrip() + "..."
-	return description
-
-
 def _project_subpage_rows(project: str) -> list[list[str]]:
 	project_enc = quote(project, safe="/")
 	rows: list[list[str]] = []
@@ -206,13 +187,6 @@ def _project_subpage_rows(project: str) -> list[list[str]]:
 	return rows
 
 
-def _inject_subpage_stylesheet(html_content: str, stylesheet_href: str) -> str:
-	link_tag = f'<link rel="stylesheet" href="{stylesheet_href}">'
-	if "<head" in html_content.lower():
-		return html_content.replace("</head>", f"{link_tag}</head>", 1)
-	return f"{link_tag}{html_content}"
-
-
 # ---------- Routes (no project) ----------
 
 
@@ -314,9 +288,22 @@ def activity_page(
 			event_label += f"?a=commit&h={quote(oid, safe='')}'>{esc_html(oid[:7])}</a>"
 		else:
 			event_label = esc_html(event["kind"]) or ""
-		description = _truncate_activity_description(event.get("description"))
+		description_raw = event.get("description")
+		if not description_raw:
+			description = ""
+		elif "\n" in description_raw:
+			description = description_raw.splitlines()[0][:80].rstrip() + "..."
+		elif len(description_raw) > 80:
+			description = description_raw[:80].rstrip() + "..."
+		else:
+			description = description_raw
+		try:
+			age_seconds = datetime.now(UTC).timestamp() - float(event["timestamp"])
+			activity_time = "right now" if age_seconds <= 0 else age_string(age_seconds)
+		except (ValueError, OSError):
+			activity_time = ""
 		rows.append([
-			esc_html(_format_activity_time(event["timestamp"])) or "",
+			esc_html(activity_time) or "",
 			f"<a href='/project/{quote(project_name, safe='/')}'>{esc_html(project_name)}</a>",
 			event_label,
 			esc_html(description) or "",
@@ -541,7 +528,11 @@ def project_subpage(
 		)
 		if content_lc.startswith("<!doctype html") or "<html" in content_lc:
 			if raw:
-				return HTMLResponse(_inject_subpage_stylesheet(content, "/static/main.css"))
+				stylesheet_href = "/static/main.css"
+				link_tag = f'<link rel="stylesheet" href="{stylesheet_href}">'
+				if "<head" in content.lower():
+					return HTMLResponse(content.replace("</head>", f"{link_tag}</head>", 1))
+				return HTMLResponse(f"{link_tag}{content}")
 			project_enc = quote(project, safe="/")
 			subpage_enc = quote(subpage_name, safe="")
 			iframe_src = f"/project/{project_enc}/subpage/{subpage_enc}?raw=true"
@@ -596,7 +587,7 @@ def dispatch(
 			}.get(obj_type, "object")
 		else:
 			action = "summary"
-	if not is_valid_action(action, ACTIONS):
+	if action not in ACTIONS:
 		raise HTTPException(status_code=400, detail="Unknown action")
 	if action in ("opml", "project_list", "project_index"):
 		raise HTTPException(status_code=400, detail="Project not needed for this action")
diff --git a/pygitweb/projects.py b/pygitweb/projects.py
index 0035def..f263211 100644
--- a/pygitweb/projects.py
+++ b/pygitweb/projects.py
@@ -17,10 +17,6 @@ from pygitweb.config import settings
 from pygitweb.validation import check_export_ok
 
 
-def _export_ok_path(git_dir: str, export_ok: str) -> bool:
-	return not export_ok or os.path.isfile(os.path.join(git_dir, export_ok))
-
-
 def project_in_list(
 	project: str,
 	get_projects_list_fn: Callable[[], list[dict[str, Any]]],
diff --git a/pygitweb/validation.py b/pygitweb/validation.py
index 6684404..612a799 100644
--- a/pygitweb/validation.py
+++ b/pygitweb/validation.py
@@ -12,26 +12,6 @@ from collections.abc import Callable
 
 import pygit2
 
-# OID regex: 40 hex (SHA-1) or 40+24 (SHA-256). Port of $oid_regex / oid_nlen_regex.
-OID_PATTERN = re.compile(r"^[0-9a-fA-F]{7,64}$")
-SHA1_LEN = 40
-SHA256_EXTRA = 24
-
-
-def oid_nlen_regex(length: int | str) -> re.Pattern[str]:
-	"""Regex matching exactly `length` hex chars. Port of oid_nlen_regex."""
-	if isinstance(length, str) and "-" in length:
-		lo, hi = length.split("-")
-		return re.compile(f"^[0-9a-fA-F]{{{int(lo)},{int(hi)}}}$")
-	n = int(length)
-	return re.compile(f"^[0-9a-fA-F]{{{n}}}$")
-
-
-def oid_nlen_prefix_infix_regex(nlen: int, prefix: str, infix: str) -> re.Pattern[str]:
-	"""Two OID-like groups with literal prefix and infix. Port of oid_nlen_prefix_infix_regex."""
-	rx = oid_nlen_regex(nlen)
-	return re.compile(f"^{re.escape(prefix)}{rx.pattern}{re.escape(infix)}{rx.pattern}$")
-
 
 def is_valid_pathname(input_path: str | None) -> bool:
 	"""No '.', '..' as path elements, no null, no doubled slashes. Port of is_valid_pathname."""
@@ -55,15 +35,6 @@ def is_valid_ref_format(input_ref: str | None) -> bool:
 	return not re.search(r"[\x00-\x20\x7f ~^:?*\[\]]", input_ref)
 
 
-def is_valid_refname(input_ref: str | None) -> bool:
-	"""Either full OID hex or valid pathname + ref format. Port of is_valid_refname."""
-	if input_ref is None:
-		return False
-	if OID_PATTERN.match(input_ref):
-		return True
-	return is_valid_pathname(input_ref) and is_valid_ref_format(input_ref)
-
-
 def check_export_ok(
 	git_dir: str,
 	export_ok: str = "",
@@ -84,11 +55,6 @@ def check_export_ok(
 	return not export_auth_hook or export_auth_hook(git_dir)
 
 
-def is_valid_action(action: str | None, allowed_actions: set[str]) -> bool:
-	"""Action is in allowed set. Port of is_valid_action."""
-	return action in allowed_actions if action else False
-
-
 def is_valid_project(
 	project: str | None,
 	projectroot: str,
diff --git a/pygitweb_pytesthtml/action_pytesthtml.py b/pygitweb_pytesthtml/action_pytesthtml.py
index 4e0a05b..6db7b6d 100644
--- a/pygitweb_pytesthtml/action_pytesthtml.py
+++ b/pygitweb_pytesthtml/action_pytesthtml.py
@@ -1,15 +1,17 @@
-from pygitweb.api.action import Action
-from pygitweb.api.project import Project
+import subprocess
+
 from fastapi import Request
 
-import subprocess
+from pygitweb.api.project import Project
+
 
 def ActionPytestHtml(Action):
-    """
-    ActionPytestHtml: Run pytest and render the results.
-    """
-    def action_name(self) -> str:
-        return "pytesthtml_run"
-    
-    def action(self, project: Project, user: request: Request = None) -> None:
-        subprocess.run(["pytest", "--html=.pygitweb/pytest_report.html", "--self-contained-html"], cwd=project.path)
\ No newline at end of file
+	"""
+	ActionPytestHtml: Run pytest and render the results.
+	"""
+
+	def action_name(self) -> str:
+		return "pytesthtml_run"
+
+	def action(self, project: Project, req: Request = None) -> None:
+		subprocess.run(["pytest", "--html=.pygitweb/pytest_report.html", "--self-contained-html"], cwd=project.path)
