remove some useless code and add scanner