Utility functions.