The alternative, I think, would basically be, if(OPTION_SCROLL_ID) { return _search/scroll } else { return entire rest of function }. (Or, alternatively, set $path from both code paths and then return it at the end of the function.) It's not a big deal to get the function down to one exit point, but it didn't seem to me to add that much in the way of readability. I can change it whichever way at your preference.