utility function improvements