refactored refresh page to work with jinja2
cleanup
cleanup