Refactor jdt code into a separate object, tidy up a few warnings