refactored locate