optimize by storing the gists