Added cache for faster generation