Updated to be more generic.