Miscellaneous small piecs of code