added get location without function
fixed rubocop issues