Utilities and useful code I accumulate