Code cleanup

This is a bunch of code fixes regarding

* imports
* keyword "this"
* casting
* override annotation
* deprecated annotation