remove warning and unused code