refactor edit_path and destroy_path into helper methods