remove some findbugs issues

* unused code
* convert explicit type casts to generic method invocations