Refactoring post-login forwarding