Tidy locations code