Miscellaneous functions for tools