re-arranges ws request func