refactor rename function