better handling for refresh_token view

For your PR - moves the refresh token markup into one place and wraps the whole thing in the if.

Please merge this, and feel free to rebase it into a single commit for your PR