remove unused code and console message