Improve edit and rename functions