fix compile warnings
remove unused functions