Designed the locator API to abstract all locating operations and remove duplicate logic + some other refactoring.