Implement internal functions.