Implement some common function that should really be shared.