Why not pull this out into a function that is called setremix or something.

Then rename this function to editTemplate.

Reverse the logic of pageEdit to isRemix or something.

Then in the one path where /remix is true, call setRemix before editTemplate.