Can we avoid to copy-paste this function ?