remove unused code, fix warning