minor refactoring
router back button better detection for previous history item

if there is not previous history item, then back button link works like
normal link