refactor doing requests