Misc helper functions intended as a personal library