Simplify code: remove location helper