repo prune: Refactor to make it less horrible