remove unused variable and function

Issue(s) found via [cppcheck](http://cppcheck.sourceforge.net/).