remove unused code and compiler warnings