Adding some utility functions.