add some utility functions.