Update to be more general