Move global functions into classes.