it's generally bad to define the same piece of data twice.  here you're separately hardcoding "/edit" and 6, the length of "/edit".  it'd be super easy to change the name of your path to "/_editor" and forget to change the 6 to 8.