Cleaned up location code.