Remove unused and buggy function