utility functions miscellaneous