Refactor get distance between two location and fragment method