some more request handling refactoring