Move some functions to a higher level.