New functions, see description in commits