Clean up some utility functions...