Bulletproof collection of helpful functions, validations, casting