utility functions.