Clean up some of the utility functions