More general functions.