Moved some functions into tasks.