Remove unused code detected by scrutinizer