refactoring for new request structure (broken, probably for a while)