halfway in refactoring request handling to allow redirects