Extracted location into function