Added some useful generic methods.