Misc library functions/classes