General tidying, better approach to recursive functions with a top-level quantifier