Remove unused variable and defines