Generalized get and set.