Maybe break these clauses into separate function clauses