Factor out helper as file-private function
Add rename test