Cleaned up load json function.