Move some functions to Service classes.