More generic code.