remove unused code

went through the scrutinizer report and fixed some obvious stuff like unused variables.
How could this work previously? o.O

![](http://replygif.net/i/881.gif)