Remove duplication in basic HTTP calls