Made refactor of GPS functionality. #1554