Move unused but nevertheless useful function into separate module.