refactor: remove dead functions and simplify function definition
Created by: rvantonder
My stack was broken when I had to revert in #7634. This PR simply adds the remaining two safe PRs:
- #7608 (already approved, but that had to revert to unwind the stack back to #7607)
- #7609 (already approved, but had not been merged yet)
I could have force pushed this into #7609 , but since there was a revert/fix cycle I prefer to make the rectified changes visible for another review.