Cache member functions. Avoids a lot of lookups and casts.