Revert "Removed unused function"

This reverts commit 40f6da8283ae506c928722bc6da5b5a7856174d7.