fix request, minor refactoring