Updated the org and location selection logic.

We now directly fetch the org and location separately.
so no more to deal with "@" char and it's complexities.
Merge pull request #1532 from kbidarkar/replace-fix

Updated the org and location selection logic.