Generation and maintenance of immunological memory