Extracted out code to locate running location.