small refactoring (implemented goto_return_url_or_root)